import { uploadFile, get } from './request';

export function upload(params, cb) {
  return uploadFile('/common/interface/upload_img', params, {
    returnDefault: true
    // onUploadProgress: (evt) => {
    //   console.log(evt);
    //   const percent = (evt.loaded / evt.total) * 100;
    //   if (typeof cb == 'function') {
    //     cb(percent);
    //   }
    // }
  });
}

export function downloadExecl(url, data) {
  return get(url, data, {
    responseType: 'blob',
    awalysSuccess: true
  });
}
